<?php

/*
* 验证码逻辑
*/
class VcodeController extends Yaf_Controller_Abstract
{

    //只允许验证的类型
    private $vcodeType = [
        'login'
    ];

    public function createAction()
    {
        $type = 'login';
        $vcode = new VCode();
        $vcode->createImg();
        if (in_array($type, $this->vcodeType)) {
            $_SESSION['VCODE_TYPE_' . $type] = $vcode->getCode();
            $vcode->outputImg();
        }
    }
}
